import { Inject, Controller, Get, Query } from '@midwayjs/decorator';
import { Context } from '@midwayjs/koa';
import { CommonService } from '../service/common.service';

@Controller('/common')
export class CommonController {
  @Inject()
  ctx: Context;

  @Inject()
  commonService: CommonService;

  @Get('/getCode')
  async getCode(@Query() data: any): Promise<any> {
    const result = await this.commonService.getCode(data);
    return result;
  }

  @Get('/getQiniuToken')
  async getQiniuToken(): Promise<any> {
    const result = await this.commonService.getQiniuToken();
    return result;
  }
}
